--- https://github.com/Frege/frege/issues/284 Issue 284
---
--- Tests that imported record can be used even if mangled.
module tests.comp.Issue284a where

import tests.comp.Issue284 (Generic')

access :: Generic' a -> Maybe a
access x = x.unGeneric'

match :: Generic' a -> Maybe a
match (Generic'{unGeneric'}) = unGeneric'

match' :: Generic' a -> Maybe a
match' (Generic'{unGeneric'=a}) = a

update :: b -> Generic' a -> Generic' b
update b x = x.{ unGeneric' = Just b }

change :: (a -> b) -> Generic' a -> Generic' b
change f x = x.{ unGeneric' <- fmap f }

main = println (access (Generic' (Just "also O'kay")))